package initialize

import (
	mlMongo "user_service/mongo"
)

type Application struct {
	Mongo mlMongo.Client
}

func App() Application {
	app := &Application{}
	// mongodb全局
	app.Mongo = NewMongoDatabase()
	// 初始化日志记录
	InitLogger()
	return *app
}

// CloseDBConnection 释放资源
func (app *Application) CloseDBConnection() {
	CloseMongoDBConnection(app.Mongo)
}
